/**
 * 取得有前缀的类名
 *
 * 用法：
 * import { hookDesign } from '@/hooks/hookDesign'
 * const { getPrefixCls } = hookDesign()
 * console.log(getPrefixCls("abc123"))
 * 输出 v-abc123
 */
import variables from "@/styles/variables.module.scss";

export const hookDesign = () => {
    const scssVariables = variables;

    /**
     * 取得带有命名空间的名称
     * @param {string}name
     * @returns '${namespace}-${name}'
     */
    const getPrefixCls = (name: string) => {
        return `${scssVariables.namespace}-${name}`;
    };

    return {
        getPrefixCls,
    };
};
